package com.example.module_mine.ui

import androidx.lifecycle.MutableLiveData
import com.example.lib_common.base.BaseViewModel
import com.example.module_mine.R
import com.example.module_mine.login.loginnet.MineModel
import com.example.module_mine.register.registernet.RegisterRePo
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class MineViewModel @Inject constructor(private val registerRePo: RegisterRePo) :
    BaseViewModel() {
    val minelivedata by lazy {
        MutableLiveData<List<MineModel>>()
    }

    fun getmine() {
        execute(
            action = registerRePo.getmine(),
            onFinish = {
                minelivedata.value = getlist()
            },
            onError = {

            }
        )
    }

    fun getlist(): List<MineModel> {
        val list = ArrayList<MineModel>()
        list.add(MineModel(R.drawable.fangkeguanli, "访客管理"))
        list.add(MineModel(R.drawable.wuyefuwu, "物业服务"))
        list.add(MineModel(R.drawable.shequhuodong, "社区活动"))
        list.add(MineModel(R.drawable.sheshiyuyue, "设施预约"))
        list.add(MineModel(R.drawable.shenghuofuwu, "生活服务"))
        list.add(MineModel(R.drawable.menjinguanli, "门禁管理"))
        return list
    }

    fun getlist2(): List<MineModel> {
        val list = ArrayList<MineModel>()
        list.add(MineModel(R.drawable.fangkeguanli, "我的申请"))
        list.add(MineModel(R.drawable.wuyefuwu, "我的审核"))
        list.add(MineModel(R.drawable.shequhuodong, "我的公告"))
        list.add(MineModel(R.drawable.sheshiyuyue, "人员管理"))
        list.add(MineModel(R.drawable.shenghuofuwu, "访客管理"))
        list.add(MineModel(R.drawable.menjinguanli, "物业服务"))
        return list
    }
}